 <template>
        <Card title="欢迎注册" class="border-0" header-class="bg-white"  footer-class="bg-white">
            <template v-slot:header>
                <h3>欢迎注册</h3>
            </template>
            <CardForm submit-button-text="注 册" @submit="regist" key="regist"></CardForm>
            <template v-slot:footer>
                <!-- <button class="btn btn-link text-secondary"
                    @click="setUserState(0)" >如果您已注册账户，请点击此处登录</button> -->
                <router-link to="/login" class="btn btn-link text-secondary"  >如果您已注册账户，请点击此处登录</router-link>
            </template>
        </Card>
</template>

<script>
import Card from '@/components/Card';
import CardForm from '@/components/CardForm';

export default {
    name:"Regist",
    components:{
        Card,
        CardForm
    },
    methods: {
           regist(username, password) {
           this.$store.dispatch("regist",{
               username:username,
               password:password
           })
           alert("注册完成")
          this.$router.push({path:'/login'})
        }
    }
}
</script>